package com.qww;

import java.util.Random;

// 随机生成字母，并判断他们是元音还是辅音字母
// A的ASCII码是65，a的ASCII码是97
public class Test03 {

    public static void main(String[] args) {
        Random r = new Random(10);
        char ch;
        for (int i = 0; i < 10; i++) {
            if (i % 2 == 0) ch = (char) (r.nextInt(26) + 65);
            else ch = (char) (r.nextInt(26) + 97);
            System.out.print(ch + ", " + (int)ch + " : ");
            switch (Character.toUpperCase(ch)) {
                case 'A':
                case 'E':
                case 'I':
                case 'O':
                case 'U': System.out.println("vowel"); break;
                case 'Y':
                case 'W':
                    System.out.println("sometimes a vowel"); break;
                default: System.out.println("consonant");
            }
        }
    }
}
